<template>
    <div>
        <div class="selectValue">
            <label class="value">
                <span class="img">
                    <img src="../../../assets/images/airIndex/zxczjl.png" />
                </span>
                <span class="title">充值记录</span>
            </label>
        </div>
        <div id="chart-container" style="padding: 0 10px 10px 10px; margin: 0 auto" class="hiddenScroll">
            <el-table :height="'calc(100vh - 570px)'" :data="dataList" style="width: 100%" size="small" border>
                <el-table-column prop="acName" label="账户名称" align="left"> </el-table-column>
                <el-table-column prop="sum" label="充值金额" align="center" width="70"> </el-table-column>
                <el-table-column prop="pay_time" label="充值时间" width="130" align="center">
                    <template slot-scope="scope"> {{ getTime(scope.row.pay_time) }} </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script>
import {AjaxCommon} from '@/libs/apiCommon'
import {PopupCommon} from '@/libs/popupCommon'
import moment from 'moment'
export default {
    props: ['currentNodeId', 'currentNodeName'],
    mounted() {},
    data() {
        return {
            radio2: '年',
            dataList: [
                // {id: 1, bl: '40', value: '2025-10-10 11:12', name: 'JS-BB-1-11'},
                // {id: 2, bl: '30', value: '2025-10-10 12:12', name: 'JS-BB-1-12'},
                // {id: 3, bl: '40', value: '2025-10-10 14:12', name: 'JS-BB-1-13'}
            ]
        }
    },
    watch: {
        currentNodeId: {
            handler(newV) {
                if (newV && newV != '1') {
                    this.getData()
                }
            },
            deep: true,
            immediate: true
        }
    },
    methods: {
        getTime(value) {
            return moment(value).format('YYYY-MM-DD HH:mm')
        },
        getData() {
            const currentNodeId = this.currentNodeId
            const self = this
            AjaxCommon(`/api/Payment/GetPayRecordsByBd/${currentNodeId}/1/1000`, 'get', null).then((res) => {
                if (res?.data?.Code == 200) {
                    const data = res?.data.Message
                    self.dataList = data?.rows
                    // self.pageCount = parseInt(data?.total)
                } else {
                    PopupCommon.notify('error', res?.data?.msg)
                }
            })
        }
    }
}
</script>

<style scoped lang="scss">
.rightTitle {
    text-align: center;
    height: 30px;
    line-height: 30px;
    margin-bottom: 10px;
    margin-top: 20px;
    span {
        text-align: center;
        font-weight: bold;
        font-size: 18px;
    }
    label {
        text-align: right;
        float: right;
        color: #3b8cfc;
        margin-right: 15px;
        cursor: pointer;
        font-size: 16px;
    }
    .printer {
        color: #3b8cfc;
    }
    .download {
        color: #3b8cfc;
    }
}

.selectValue {
    display: flex;
    height: 50px;
    background: #f5f5f5;
    margin: 10px;
    border-radius: 4px;
    line-height: 50px;
    .el-radio {
        margin-right: 5px;
    }
    .el-radio__label {
        padding-left: 5px;
    }
}
.selectValue .value {
    margin-left: 20px;
    font-size: 16px;

    .img {
        display: block;
        float: left;
        margin-top: 1px;
    }
    .title {
        // color: #4e66ed;
        margin-left: 10px;
    }
}
.selectValue .rightValue {
    flex: 1;
    text-align: right;
    margin-right: 20px;
    .btnList {
        .hover {
            border-color: #2680fa !important;
        }
        .btnItem {
            display: inline-block;
            height: 26px;
            width: 60px;
            margin-top: 7px;
            margin-left: 10px;
            line-height: 23px;
            text-align: left;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            cursor: pointer;
            &:hover {
                border-color: #2680fa;
            }
            &:first-child {
                margin-left: 0 !important;
            }
            svg {
                margin-top: 2px;
                float: left;
                margin-left: 8px;
                margin-right: 3px;
            }
            label {
                font-size: 14px;
            }
        }
    }
}
.selectValue .rightValue span {
    font-size: 16px;
    color: #666;
}
.selectValue .rightValue span b {
    font-size: 16px;
    color: #333;
}
.selectValue .rightValue span label {
    width: 10px;
    display: inline-block;
    height: 10px;
    border-radius: 10px;
    margin-left: 40px;
    margin-right: 5px;
}
</style>
